<template>
	<view class="order">
		<!-- <view v-if="hasLogin"> -->
		<!-- 导航 按月服务订单 -->
		<u-navbar :is-back="true" title="订单" :height="navHeight" title-color="#3F3F3F" :title-bold="true" :background="background" :border-bottom="false"></u-navbar>
		<!-- tap切换 -->
		<view style="position: fixed;z-index: 2;width: 750rpx;">
			<u-tabs
				:list="list"
				active-color="#FCA800"
				inactive-color="#000000"
				font-size="30"
				font-weight="500" 
				:is-scroll="true"
				:current="current"
				:gutter="17"
				@change="change"
			></u-tabs>
		</view>
		<!-- end -->
		<view class="lings"></view>
		<!-- 列表数据 -->
		<view style="background-color: #F5F5F5;">
			<mescroll-body
				top="0"
				:down="downOption"
				:up="upOption"
				:height="comHeight"
				ref="mescrollRef"
				@init="mescrollInit"
				@down="downCallback"
				style="-webkit-overflow-scrolling: touch;background-color: #F5F5F5!important;"
			>
				<view class="oderList" v-for="(item, index) in goosList" :key="index" @tap="orderDetai(item.orderId, item.orderStatus, item.chargeType)">
					<!--套餐订单 -->
					<view v-if="item.chargeType == 5" class="allorder">
						<view class="shop">
							<view>
								<view class="shop_name">
									<image :src="item.entPortrait" mode=""></image>
									<view style="margin-left: 12rpx;color: #000000;">{{ item.entName }}</view>
									<image src="../../static/icon/shangjian.png" mode="" style="width: 11rpx;height: 20rpx;margin-left: 28rpx;"></image>
								</view>
							</view>
							<view :class="item.orderStatus == 'CANCEL' || item.orderStatus == 'FINISH_APPRAISE' ? 'shop_statuss' : 'shop_status'">{{ item.statusName }}</view>
						</view>
						<view class="line"></view>
						<view class="orders">
							<image style="width:142rpx ;height:156rpx;" :src="item.packageImg" mode="aspectFill"></image>
							<view class="person" style="position: relative;">
								<view style="display: flex;align-items: center;">
									<image src="../../static/img/tuans.png" mode="" style="width: 26rpx;height: 26rpx;"></image>
									<view class="money" style="color:#3F3F3F;font-size: 26rpx;font-weight: 500;margin-left: 12rpx;">{{ item.packageName }}</view>
								</view>
								<view class="ordertime">
									<text class="users text_color" style="color: #979797;">下单时间：</text>
									<text class="order_content text_color" style="color: #979797;">{{ item.createTime.slice(0, 16) }}</text>
								</view>
								<view class="servertime">
									<text class="order_content text_color" style="color: #979797;">{{ item.extTimeStr }}</text>
								</view>
								<view style="position: absolute;right: 0rpx;top: 0rpx;text-align: right;">
									<!-- <view style="font-size: 26rpx;color:#F29423 ;font-weight: bold;">{{item.statusName}}</view> -->
									<!-- <view style="font-size: 26rpx;color:#3F3F3F ;margin-top: 30rpx;">X{{item.amount}}</view> -->
								</view>
								<view style="font-size:26rpx;text-align: right;margin-top: 26rpx;">
									<text style="color: #6E6E6E;">合计：</text>
									<text style="color: #222222;font-size: 26rpx;">￥</text>
									<text style="color: #222222; font-weight: bold;font-size: 30rpx;" class="">{{ item.moneyStr }}</text>
								</view>
								<view class="ordermoney" style="margin-top: 10rpx;margin-right: -10rpx!important;">
									<view></view>

									<view style="display: flex;justify-content: space-between;">
										<view v-for="(items, indexs) in item.buttons" :key="indexs">
											<u-button
												size="mini"
												type="warning"
												shape="square"
												:custom-style="customFype"
												v-if="items.redirectType == 2"
												style="padding-left: 16rpx;border: none;"
												@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
											>
												{{ items.title }}
											</u-button>

											<u-button
												size="mini"
												type="warning"
												:custom-style="customType"
												shape="square"
												v-if="items.redirectType != 2 && items.color == 'HOLLOW_YELLOW'"
												style="padding-left: 16rpx;"
												@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
											>
												{{ items.title }}
											</u-button>

											<u-button
												size="mini"
												:hair-line="false"
												:custom-style="customStyle"
												shape="square"
												v-if="items.redirectType != 2 && items.color == 'GREY'"
												style="padding-left: 16rpx;border: none;"
												@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
											>
												{{ items.title }}
											</u-button>

											<u-button
												size="mini"
												type="warning"
												shape="square"
												:custom-style="customFype"
												v-if="items.redirectType != 2 && items.color == 'YELLOW'"
												style="padding-left: 16rpx;border: none;"
												@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
											>
												{{ items.title }}
											</u-button>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>

					<view v-else>
						<!-- 匹配中再取消orderType=2 orderStatus=CANCEL -->
						<view v-if="item.orderStatus == 'CANCEL' && item.orderType == 2">
							<view class="allorder">
								<view class="orders">
									<image src="../../static/img/1-42.png" mode="aspectFill" style="width: 66px;height: 66px;"></image>
									<view class="person">
										<view class="order_user" style="display: flex;justify-content:space-between;">
											<view class="users" style="font-size: 30rpx;">
												{{ item.businessName }}
												<!-- <image src="../../static/img/1-41.png" style="width: 26rpx;height: 26rpx;margin-left: 12rpx;"></image> -->
											</view>

											<view :class="item.orderStatus == 'CANCEL' || item.orderStatus == 'FINISH_APPRAISE' ? 'shop_statuss' : 'shop_status'">
												{{ item.statusName }}
											</view>
										</view>
										<view class="ordertime" style="padding: 14rpx 0 8rpx 0;">
											<text class="users" style="color: #979797;">下单时间：</text>
											<text class="order_content" style="color: #979797;">{{ item.createTime.slice(0, 16) }}</text>
										</view>
										<view class="servertime">
											<!-- <text class="users">服务时间：</text>
									<text class="order_content">{{item.extTimeStr}}</text> -->
											<text class="order_content" style="color: #979797;">{{ item.extTimeStr }}</text>
										</view>
									</view>
								</view>
								<view class="ordermoney">
									<view></view>
									<view style="display: flex;justify-content: space-between;margin-bottom:14rpx;">
										<view v-for="(items, indexs) in item.buttons" :key="indexs">
											<u-button
												size="mini"
												type="warning"
												shape="square"
												:custom-style="customFype"
												v-if="items.redirectType == 2"
												style="padding-left: 16rpx;border: none;"
												@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
											>
												{{ items.title }}
											</u-button>
											<u-button
												size="mini"
												type="warning"
												:custom-style="customType"
												shape="square"
												v-if="items.redirectType != 2 && items.color == 'HOLLOW_YELLOW'"
												style="padding-left: 16rpx;"
												@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
											>
												{{ items.title }}
											</u-button>
											<u-button
												size="mini"
												:hair-line="false"
												:custom-style="customStyle"
												shape="square"
												v-if="items.redirectType != 2 && items.color == 'GREY'"
												style="padding-left: 16rpx;border: none;"
												@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
											>
												{{ items.title }}
											</u-button>
											<u-button
												size="mini"
												type="warning"
												shape="square"
												:custom-style="customFype"
												v-if="items.redirectType != 2 && items.color == 'YELLOW'"
												style="padding-left: 16rpx;border: none;"
												@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
											>
												{{ items.title }}
											</u-button>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view v-else>
							<!-- 非匹配中订单样式 -->
							<view v-if="item.orderStatus != 'MATCHING'">
								<view class="shop">
									<view>
										<view class="shop_name">
											<image :src="item.entPortrait" mode=""></image>
											<view style="margin-left: 12rpx;color: #000000;">{{ item.entName }}</view>
											<image src="../../static/icon/shangjian.png" mode="" style="width: 11rpx;height: 20rpx;margin-left: 28rpx;"></image>
										</view>
									</view>
									<view :class="item.orderStatus == 'CANCEL' || item.orderStatus == 'FINISH_APPRAISE' ? 'shop_statuss' : 'shop_status'">
										{{ item.statusName }}
									</view>
								</view>
								<view class="line"></view>
								<view class="allorder">
									<view class="orders">
										<image :src="item.employeePortrait" mode="aspectFill"></image>
										<view class="person">
											<view class="order_user">
												<view class="users" style="font-size: 30rpx;font-weight: bold;width: 27%;">{{ item.employeeName }}</view>
												<view class="rate" style="color: #f29423;background-color: #FFF6EB;padding: 2rpx 10rpx;border-radius: 20rpx;">
													{{ item.score }}分
												</view>
												<view class="order_content" style="width: 32%;text-align: right;">{{ item.businessName }}</view>
											</view>
											<view class="ordertime">
												<text class="users" style="color: #979797;">下单时间：</text>
												<text class="order_content" style="color: #979797;">{{ item.createTime.slice(0, 16) }}</text>
											</view>
											<view class="servertime">
												<text class="order_content" style="color: #979797;">{{ item.extTimeStr }}</text>
											</view>
											<view class="price" style="text-align: right;color: #222222;font-weight: 800;">
												<text class="jine" style="color: #222222;font-size: 26rpx;" v-if="item.moneyStr">￥</text>
												<text class="money" style="font-size: 30rpx;color: #222222;">{{ item.moneyStr }}</text>
											</view>
										</view>
									</view>
									<view class="ordermoney">
										<view></view>
										<view style="display: flex;justify-content: space-between;">
											<view v-for="(items, indexs) in item.buttons" :key="indexs">
												<u-button
													size="mini"
													type="warning"
													shape="square"
													:custom-style="customFype"
													v-if="items.redirectType == 2"
													style="padding-left: 16rpx;border: none;"
													@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
												>
													{{ items.title }}
												</u-button>
												<u-button
													size="mini"
													type="warning"
													:custom-style="customType"
													shape="square"
													v-if="items.redirectType != 2 && items.color == 'HOLLOW_YELLOW'"
													style="padding-left: 16rpx;"
													@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
												>
													{{ items.title }}
												</u-button>
												<u-button
													size="mini"
													:hair-line="false"
													:custom-style="customStyle"
													shape="square"
													v-if="items.redirectType != 2 && items.color == 'GREY'"
													style="padding-left: 16rpx;border: none;"
													@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
												>
													{{ items.title }}
												</u-button>
												<u-button
													size="mini"
													type="warning"
													shape="square"
													:custom-style="customFype"
													v-if="items.redirectType != 2 && items.color == 'YELLOW'"
													style="padding-left: 16rpx;border: none;"
													@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
												>
													{{ items.title }}
												</u-button>
											</view>
										</view>
									</view>
									<view class="line"></view>
								</view>
							</view>

							<view v-else>
								<!-- 匹配中订单列表 -->
								<view class="allorder">
									<view class="orders">
										<image src="../../static/img/1-42.png" mode="aspectFill" style="width:66px;height: 66px;"></image>
										<view class="person">
											<view class="order_user" style="display: flex;justify-content:space-between;">
												<view class="users" style="font-size: 30rpx;">
													{{ item.businessName }}
													<image src="../../static/img/1-41.png" style="width: 26rpx;height: 26rpx;margin-left: 12rpx;"></image>
												</view>

												<view :class="item.orderStatus == 'CANCEL' || item.orderStatus == 'FINISH_APPRAISE' ? 'shop_statuss' : 'shop_status'">
													{{ item.statusName }}
												</view>
											</view>
											<view class="ordertime" style="padding: 14rpx 0 8rpx 0;">
												<text class="users" style="color: #979797;">下单时间：</text>
												<text class="order_content" style="color: #979797;">{{ item.createTime.slice(0, 16) }}</text>
											</view>
											<view class="servertime">
												<!-- <text class="users">服务时间：</text>
							<text class="order_content">{{item.extTimeStr}}</text> -->
												<text class="order_content" style="color: #979797;">{{ item.extTimeStr }}</text>
											</view>
										</view>
									</view>
									<view class="ordermoney">
										<view></view>
										<view style="display: flex;justify-content: space-between;">
											<view v-for="(items, indexs) in item.buttons" :key="indexs">
												<u-button
													size="mini"
													type="warning"
													shape="square"
													:custom-style="customFype"
													v-if="items.redirectType == 2"
													style="padding-left: 16rpx;border: none;"
													@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
												>
													{{ items.title }}
												</u-button>
												<u-button
													size="mini"
													type="warning"
													:custom-style="customType"
													shape="square"
													v-if="items.redirectType != 2 && items.color == 'HOLLOW_YELLOW'"
													style="padding-left: 16rpx;"
													@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
												>
													{{ items.title }}
												</u-button>
												<u-button
													size="mini"
													:hair-line="false"
													:custom-style="customStyle"
													shape="square"
													v-if="items.redirectType != 2 && items.color == 'GREY'"
													style="padding-left: 16rpx;border: none;"
													@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
												>
													{{ items.title }}
												</u-button>
												<u-button
													size="mini"
													type="warning"
													shape="square"
													:custom-style="customFype"
													v-if="items.redirectType != 2 && items.color == 'YELLOW'"
													style="padding-left: 16rpx;border: none;"
													@click="anniu(items, item.orderId, item.businessId, item.chargeType, item.employeeId, item.orderStatus, item.orderType)"
												>
													{{ items.title }}
												</u-button>
											</view>
										</view>
									</view>
									<view class="line"></view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view style="padding: 40rpx 0;" v-if="!showList">
					<u-divider color="#DEDEDE" half-width="120" bg-color="#f5f5f5" border-color="#DEDEDE">{{ prompt }}</u-divider>
				</view>
				<view class="nologin" v-if="showList">
					<image src="https://beedao.oss-cn-beijing.aliyuncs.com/aafe2f18d15f4f76aa50d7947184ef62.png" mode="widthFix"></image>
					<view>暂无订单哦</view>
				</view>
				<!-- <view @tap="islogin()" class="nologin" v-if="!token">
				<image src="https://beedao.oss-cn-beijing.aliyuncs.com/aafe2f18d15f4f76aa50d7947184ef62.png" mode="widthFix"></image>
				<view>暂未登陆~</view>
			</view> -->
			</mescroll-body>
		</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
var that;
export default {
	data() {
		return {
			showList: false,
			background: {
				backgroundColor: '#ffffff'
			},
			customStyle: {
				backgroundColor: '#FFFFFF',
				color: '#363636',
				border: '2rpx solid #E5E5E5;'
			},
			customType: {
				backgroundColor: '#FFE051',
				color: '#363636'
				// border: '2rpx solid',
				// borderRadius: '30rpx',
				// fontWeight:'bold'
			},
			customFype: {
				backgroundColor: '#FFE051',
				color: '#363636'
			},
			downOption: {
				use: true,
				auto: false,
				offset: 40
			},
			upOption: {
				use: false
			},
			mescroll: null,
			prompt: '',
			tabCur: 'all',
			show: false,
			goods: [], //列表数据
			page: 1,
			pageSize: 10,
			orderstatusid: '',
			nolist: false,

			value: 4,
			list: [
				{
					name: '全部',
					sign: ''
				},
				{
					name: '待确认',
					sign: 'confirms',
					tap: 1
				},
				{
					name: '待支付',
					sign: 'pays',
					tap: 2
				},
				{
					name: '待服务',
					sign: 'needServices'
				},
				{
					name: '服务中',
					sign: 'onServices'
				},
				{
					name: '投诉中',
					sign: 'issues'
				},
				{
					name: '待评价',
					sign: 'waitAppraises'
				},
				{
					name: '已完成',
					sign: 'finishes'
				}
			],
			current: 0,
			goosList: [],
			currents: '',
			group: '',
			pays: '',
			tap: '',
			token: '',
			comHeight: 0,
			navHeight: 0,
			userId: '',
			isMade:0,
		};
	},
	onReachBottom() {
		this.page += 1;
		// this.page = 1;
		this.getGoosList();
	},
	onLoad() {
		// uni.showShareMenu();
		that = this;

		var menuButtonInfo = uni.getMenuButtonBoundingClientRect();
		const { top, width, height, right } = menuButtonInfo;
		uni.getSystemInfo({
			success: res => {
				const { statusBarHeight } = res;
				const margin = top - statusBarHeight;
				var navHeight = height + statusBarHeight + margin * 4;
				that.navHeight = height + margin * 2;
				that.comHeight = res.windowHeight - navHeight - 50 + 'px';
			}
		});
		that.token = uni.getStorageSync('token');
		if (!that.token) {
			that.showList = true;
			that.goosList = [];
		} else {
			that.is_click = true;
			var tap = this.$member.memberObj.tap;
			if (tap) {
				if (tap == 'all') {
					this.current = 0;
					this.group = '';
				} else {
					for (var i = 0; i < this.list.length; i++) {
						if (this.list[i].sign == tap) {
							this.current = i;
						}
					}
					this.group = tap;
				}
		
				this.page = 1;
				this.goosList = [];
				this.prompt = '加载中....';
		
				this.$member.setMemberObj({
					tap: null
				});
				this.getGoosList();
			} else {
				this.page = 1;
				this.goosList = [];
				this.prompt = '加载中....';
				this.getGoosList();
			}
		}
	},
	onShow() {
		//判断是否操作过订单，操作了就刷新当前状态
		if(this.isMade == 1){
			this.isMade=0;
			this.page = 1;
			this.goosList = [];
			this.prompt = '加载中....';
			this.getGoosList();
		}	
	},
	methods: {
		onShareAppMessage(res) {
			var userInfo = JSON.parse(uni.getStorageSync('userinfo'));
			this.userId = userInfo.userId;
			if (res.from === 'button') {
				// 来自页面内分享按钮
				
			}
			let opts = {
				way: true, //true JSON请求；false 表单请求
				method: 'post',
				url: 'common/insertShareLog'
			};
			let data = {};
			this.http.httpTokenRequest(opts, data).then(res => {
				//分享日志，不需要处理
			});
			return {
				title: '必到家政',
				 path:'/pages/login/login?id='+this.userId
				// imageUrl:'https://beedao.oss-cn-beijing.aliyuncs.com/cca1cf07545140e6b44c42f1c9b861d8.png',
				// path: '/pages/home/home?parentId=' + this.userId
			};
		},
		mescrollInit(mescroll) {
			this.mescroll = mescroll;
		},
		// 下拉刷新回调函数
		downCallback() {
			setTimeout(() => {
				this.page = 1;
				this.goosList = [];
				this.prompt = '加载中....';
				// this.group = '';
				this.getGoosList();
				this.mescroll.endSuccess();
			}, 1000);
		},
		change(index) {
			if (!that.token) {
				uni.showModal({
					title: '登录提示',
					content: '该功能需要登录后使用。',
					confirmText: '去登录',
					success: function(res) {
						if (res.confirm) {
							uni.navigateTo({
								url: '/pages/login/login'
							});
						} else if (res.cancel) {
							that.showList = true;
							that.goosList = [];
						}
					}
				});
				return;
			}
			this.tap = index;
			this.current = index;
			this.group = this.list[index].sign;
			this.page = 1;
			this.goosList = [];
			this.prompt = '加载中....';
			this.getGoosList();
		},
		showTab() {
			var _this = this;
			_this.show = !_this.show;
		},
		orderDetai(orderId, orderStatus, chargeType) {
			if (chargeType == 5) {
				uni.navigateTo({
					url: '../../pageageA/order/tuangouDetail_one?orderId=' + orderId + '&orderStatus=' + orderStatus
				});
			} else {
				uni.navigateTo({
					url: '../../pageageA/order/orderDetail_one?orderId=' + orderId + '&orderStatus=' + orderStatus
				});
			}
		},
		getGoosList() {
			var _this = this;
			let opts = {
				way: true, //true JSON请求；false 表单请求
				method: 'post',
				url: 'orders/my'
			};
			let data = {
				group: _this.group,
				page: _this.page,
				pageSize: _this.pageSize
			};
			_this.http.httpTokenRequest(opts, data).then(res => {
				uni.hideLoading();
				if (res.code == '200') {
					if (res.data.records.length > 0 || _this.page != 1) {
						_this.showList = false;
						if (res.data.current * res.data.size < res.data.total) {
							for (const key in res.data.records) {
								_this.goosList.push(res.data.records[key]);
							}
							_this.prompt = '加载中....';
						} else {
							for (const key in res.data.records) {
								_this.goosList.push(res.data.records[key]);
							}
							_this.prompt = '没有更多了';
						}
					} else {
						_this.showList = true;
						_this.goosList = [];
					}
				} else {
					_this.$refs.uToast.show({
						title: res.message,
						type: 'error'
					});
				}
			});
		},
		//推送
		ts() {
			uni.requestSubscribeMessage({
				tmplIds: ['IdSIZcF3KlfXRiP4wvU4jwt6hu2tU2LnbsUPfF_Tq80', 'EjQNBMRd3C1y7Y1OMAyLn7sLsRNoolBBV42v1btLchw'],
				success(res) {},
				fail(err) {}
			});
		},
		anniu(items, orderId, businessId, chargeType, employeeId, orderStatus, orderType) {
			if (that.is_click == true) {
				that.is_click = false;
				var _this = this;
				var opts = {};
				var data = {};
				switch (items.redirectType) {
					case 1:
						//请求接口
						opts = {
							way: true, //true JSON请求；false 表单请求
							method: 'post',
							url: items.uri
						};
						data = {
							orderId: orderId
						};
						_this.http.httpTokenRequest(opts, data).then(res => {
							that.is_click = true;
							if (res.code == 200) {
								_this.$refs.uToast.show({
									title: res.message,
									type: 'success'
								});
								_this.page = 1;
								_this.goosList = [];
								_this.prompt = '加载中....';
								_this.getGoosList();
								_this.is_click = true;
							} else {
								_this.$refs.uToast.show({
									title: res.message,
									type: 'error'
								});
								_this.is_click = true;
							}
						});
						break;
					case 2:
						_this.is_click = true;
						// 订单详情
						uni.navigateTo({
							url: '../../pageageA/order/orderDetail_one?orderId=' + orderId + '&orderStatus=' + orderStatus
						});
						break;
					case 3:
						_this.is_click = true;
						// 跳转定金页面
						uni.navigateTo({
							url: '../../pageageA/order/deposit?orderId=' + orderId
						});
						break;
					case 4:
						_this.is_click = true;
						// 跳转签约页面
						uni.navigateTo({
							url: '../../pageageA/order/sign?orderId=' + orderId + '&redirectType=' + items.redirectType
						});
						break;
					case 5:
						_this.is_click = true;
						// 跳转续约页面
						uni.navigateTo({
							url: '../../pageageA/order/sign?orderId=' + orderId + '&redirectType=' + items.redirectType
						});
						break;
					case 6:
						_this.is_click = true;	
						// 立即评价
						uni.navigateTo({
							url: '../../pageageA/order/evaluate?orderId=' + orderId
						});
						break;
					case 7:
						_this.is_click = true;
						// 再次下单
						uni.navigateTo({
							url:
								'../../pageageA/service/online_order?businessId=' +
								businessId +
								'&orderId=' +
								orderId +
								'&chargeType=' +
								chargeType +
								'&employeeId=' +
								employeeId +
								'&zcxd=1' +
								'&orderType=' +
								orderType
						});
						break;
					case 8:
						_this.is_click = true;
						// 跳转简历
						uni.navigateTo({
							url: '../../pageageA/home/matching/hisResume/hisResume?employeeId=' + employeeId + '&redirectId=' + businessId + '&addType=2'
						});
						break;
					case 9:
						_this.is_click = true;
						uni.showModal({
							title: '',
							content: '确定要取消该订单吗？',
							cancelText: '我再想想', // 取消按钮的文字
							confirmText: '确认', // 确认按钮文字
							cancelColor: '#F29423',
							confirmColor: '#979797',
							success: function(res) {
								that.is_click = true;
								if (res.confirm) {
									let opts = {
										way: true, //true JSON请求；false 表单请求
										method: 'post',
										url: items.uri
									};
									let data = {
										orderId: orderId
									};
									_this.http.httpTokenRequest(opts, data).then(res => {
										if (res.code == 200) {
											_this.$refs.uToast.show({
												title: res.message,
												type: 'success'
											});
											_this.page = 1;
											_this.goosList = [];
											_this.prompt = '加载中....';
											_this.getGoosList();
										} else {
											_this.$refs.uToast.show({
												title: res.message,
												type: 'error'
											});
										}
									});
								}
							}
						});
						break;
					case 10:
						// 支付日常订单
						// that.ts();
						opts = {
							way: true, //true JSON请求；false 表单请求
							method: 'post',
							url: items.uri
						};
						data = {
							orderId: orderId
						};
						_this.is_click = true;
						_this.http.httpTokenRequest(opts, data).then(res => {
							if (res.code == 200) {
								var needstr = res.data;
								uni.requestSubscribeMessage({
									tmplIds: ['IdSIZcF3KlfXRiP4wvU4jwt6hu2tU2LnbsUPfF_Tq80', 'EjQNBMRd3C1y7Y1OMAyLn7sLsRNoolBBV42v1btLchw'],
									success(res) {
										if (needstr.needPay == 0) {
											uni.navigateTo({
												url: '../../pageageA/order/paySucess?type=1' + '&orderId=' + orderId
											});
										} else {
											_this.wxpay(needstr.vxPayData);
										}
									},
									fail(err) {
										if (needstr.needPay == 0) {
											uni.navigateTo({
												url: '../../pageageA/order/paySucess?type=1' + '&orderId=' + orderId
											});
										} else {
											_this.wxpay(needstr.vxPayData);
										}
									}
								});
							} else {
								_this.$refs.uToast.show({
									title: res.message,
									type: 'error'
								});
							}
						});
						break;
					case 11:
						// 支付日常订单
						opts = {
							way: true, //true JSON请求；false 表单请求
							method: 'post',
							url: items.uri
						};
						data = {
							orderId: orderId
						};
						_this.is_click = true;
						_this.http.httpTokenRequest(opts, data).then(res => {
							if (res.code == 200) {
								var needstr = res.data;
								uni.requestSubscribeMessage({
									tmplIds: ['IdSIZcF3KlfXRiP4wvU4jwt6hu2tU2LnbsUPfF_Tq80', 'EjQNBMRd3C1y7Y1OMAyLn7sLsRNoolBBV42v1btLchw'],
									success(res) {
										if (needstr.needPay == 0) {
											uni.navigateTo({
												url: '../../pageageA/order/paySucess?type=1' + '&orderId=' + orderId
											});
										} else {
											_this.wxpay(needstr.vxPayData);
										}
									},
									fail(err) {
										if (needstr.needPay == 0) {
											uni.navigateTo({
												url: '../../pageageA/order/paySucess?type=1' + '&orderId=' + orderId
											});
										} else {
											_this.wxpay(needstr.vxPayData);
										}
									}
								});
							} else {
								_this.$refs.uToast.show({
									title: res.message,
									type: 'error'
								});
							}
						});
						break;
					case 12:
						_this.is_click = true;
						// 申请售后
						uni.navigateTo({
							url: '../../pageageA/order/cause?orderId=' + orderId + '&chargeType=' + chargeType+'&type='+1
						});
						break;
					case 13:
						_this.is_click = true;
						// 售后进度
						uni.navigateTo({
							url: '../../pageageA/order/service?orderId=' + orderId
						});
						break;
					case 14:
						_this.is_click = true;
						// 支付团购订单
						opts = {
							way: true, //true JSON请求；false 表单请求
							method: 'post',
							url: 'orders/rePay/package'
						};
						data = {
							orderId: orderId
						};
						_this.http.httpTokenRequest(opts, data).then(res => {
							if (res.code == 200) {
								var needstr = res.data;
								uni.requestSubscribeMessage({
									tmplIds: ['IdSIZcF3KlfXRiP4wvU4jwt6hu2tU2LnbsUPfF_Tq80', 'EjQNBMRd3C1y7Y1OMAyLn7sLsRNoolBBV42v1btLchw'],
									success(res) {
										if (needstr.needPay == 0) {
											uni.navigateTo({
												url: '../../pageageA/order/paySucess?type=1' + '&orderId=' + orderId
											});
										} else {
											_this.wxpayes(needstr.vxPayData, orderId);
										}
									},
									fail(err) {
										if (needstr.needPay == 0) {
											uni.navigateTo({
												url: '../../pageageA/order/paySucess?type=1' + '&orderId=' + orderId
											});
										} else {
											_this.wxpayes(needstr.vxPayData, orderId);
										}
									}
								});
							} else {
								that.is_click = true;
								_this.$refs.uToast.show({
									title: res.message,
									type: 'error'
								});
							}
						});
						break;
					default:
						break;
				}
			} else {
			}
		},
		wxpay(str) {
			let _this = this;
			let query = str;
			uni.requestPayment({
				provider: 'wxpay',
				appId: query.appId,
				timeStamp: query.timeStamp + '',
				nonceStr: query.nonceStr,
				package: query.package,
				signType: query.signType,
				paySign: query.sign,
				success: res => {
					uni.navigateTo({
						url: '../../pageageA/order/paySucess?type=1' + '&orderId=' + _this.orderId
					});
				},
				fail: val => {
					uni.navigateTo({
						url: '../../pageageA/order/paySucess'
					});
				}
			});
		},
		wxpayes(str, orderId) {
			let query = str;
			uni.requestPayment({
				provider: 'wxpay',
				appId: query.appId,
				timeStamp: query.timeStamp + '',
				nonceStr: query.nonceStr,
				package: query.package,
				signType: query.signType,
				paySign: query.sign,
				success: res => {
					uni.navigateTo({
						url: '../../pageageA/order/paySucess?type=1' + '&orderId=' + orderId + '&taocan=1'
					});
				},
				fail: val => {
					uni.navigateTo({
						url: '../../pageageA/order/paySucess'
					});
				}
			});
		}
	}
};
</script>

<style scoped lang="scss">
page {
	background-color: #f5f5f5 !important;
}
/* 导航 */
.order {
	// height: calc(100vh - var(--status-bar-height) - 44px);
	height: 100vh;
	background-color: #f5f5f5;
}

/* 未登录状态 */
.nologin {
	width: 100%;
}

.nologin image {
	width: 500rpx;
	display: block;
	margin: 0 auto;
	margin-top: 178rpx;
}

.nologin view {
	font-size: 28rpx;
	color: #333;
	text-align: center;
	margin-top: 25rpx;
}

.nologin navigator {
	width: 412rpx;
	height: 90rpx;
	// background-color: $uni-color1;
	line-height: 90rpx;
	color: #fff;
	font-size: 36rpx;
	text-align: center;
	border-radius: 45rpx;
	margin: 0 auto;
	margin-top: 100rpx;
}

.oderList {
	// width: 348px;
	// height: 198px;
	background: #ffffff;
	margin: 10rpx 0;
	border-radius: 16rpx;
}

.shop {
	display: flex;
	justify-content: space-between;
	align-items: center;
	// padding: 16rpx 22rpx 12rpx 46rpx;
	height: 64rpx;
	width: 92%;
	margin: 0 auto;
}

.shop_name {
	display: flex;
	align-items: center;
}

.shop_name image {
	width: 38rpx;
	height: 36rpx;
}

.shop_status {
	font-size: 26rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #f29423;
	opacity: 0.91;
}
.shop_statuss {
	font-size: 26rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #b0b5b8;
	opacity: 0.91;
}
.line {
	border: 2rpx solid #f1f1f1;
	opacity: 0.91;
	// margin-top: 22rpx;
}

.allorder {
	// padding-top: 12rpx;
}

.orders {
	display: flex;
	width: 92%;
	margin: 0 auto;
	padding: 20rpx 0;
}

.orders image {
	width: 152rpx;
	height: 152rpx;
}

.person {
	margin-left: 38rpx;
	width: 75%;
}

.order_user {
	display: flex;
	align-items: center;
	// padding-top: 6rpx;
	font-size: 36rpx;
	color: #3f3f3f;
}

.users {
	font-size: 26rpx;
}

.order_content {
	font-weight: 500;
	font-size: 26rpx;
	color: #3f3f3f;
}

.rate {
	font-family: PingFang SC;
	color: #f29423;
	// padding: 4rpx 0 6rpx 0;
	font-size: 30rpx;
}

.ordertime {
	padding: 34rpx 0 8rpx 0;
	font-size: 26rpx;
}

.servertime {
	font-size: 26rpx;
}

.ordermoney {
	display: flex;
	justify-content: space-between;
	margin: 0 22rpx 14rpx 0;
}

.price {
	font-size: 30rpx;
	margin-top: 26rpx;
}

.jine {
	color: #979797;
}

.money {
	color: #f29423;
}
.lings {
	height: 50px;
}
</style>
